<template>
	<view>
<view class="head">
			<image src="../../static/images/arrow_left.png" mode=""></image>
			<view class="">编辑账号</view>
			<view class="f32" @click="seaver">保存</view>
		</view>
		<view class="wen">
		金融机构可填写银行名称、支付宝机构名称；户名填写队形的账户名称
		</view>
		<view class="heads" style="margin-top: 0;">
			<view class="box-l">金融机构</view>
			<view class="box-r">
				<input type="text"  v-model="organization" />
			</view>
		</view>
		<view class="heads" style="margin-top: 0;">
			<view class="box-l">户名</view>
			<view class="box-r">
				<input type="text"  v-model="account_name" />
			</view>
		</view>
		<view class="heads" style="margin-top: 0;">
			<view class="box-l">账号</view>
			<view class="box-r">
				<input type="text"  v-model="account_no" />
			</view>
			
		</view>
		<view class="btn" @click="del">
			删除
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
		      arr:{},
				  account_id:'',
				  organization:'',
				  account_name:'',
				  account_no:'',
				
			}
		},
		onLoad(e) {
			this.arr=JSON.parse(e.id);
			this.account_id=this.arr.account_id,
			this.organization=this.arr.organization,
			this.account_name=this.arr.account_name,
			this.account_no=this.arr.account_no
		},
		methods: {
			seaver(){
				this.$ajax('api/v1.shop/receiveAccount', {
					act:'edit',
					organization:this.organization,
					account_name:this.account_name,
					account_no:this.account_no,
					account_id:this.account_id
				})
					.then(res => {
						console.log(res);
					})
					.catch(res => {
						console.log(Error);
					});
			},
			del(){
				
				this.$ajax('api/v1.shop/receiveAccount', {
					act:'del',
					account_id:this.account_id
				})
					.then(res => {
						uni.navigateTo({
						    url: 'paymentAccount'
						});
					})
					.catch(res => {
						console.log(Error);
					});
				
			}
		}
	}
</script>

<style lang="scss">
page {
	background-color: #f7f4f8;
}
.head {
	height: 88rpx;
	line-height: 88rpx;
	background-color: #249af6;
	color: #ffffff;
	display: flex;
	justify-content: space-between;
	padding: 0 30rpx;
	font-size: 36rpx;
	font-family: PingFang SC;
	font-weight: 500;
	image {
		width: 22rpx;
		height: 39rpx;
		margin-top: 25rpx;
	}
}
.wen {
	line-height: 42rpx;
	font-size: 28rpx;
	font-family: PingFang SC;
	font-weight: 500;
	color: rgba(102, 102, 102, 1);
	padding: 30rpx;
	box-sizing: border-box;
}
.heads {
	height: 110rpx;
	line-height: 110rpx;
	background-color: #ffffff;
	margin-top: 30rpx;
	display: flex;
	justify-content: space-between;
	padding: 0 30rpx;
	font-size: 32rpx;
	font-family: PingFang SC;
	font-weight: 500;
	position: relative;
	border-bottom: 2rpx solid #cccccc;
	image {
		width: 18rpx;
		height: 33rpx;
		vertical-align: middle;
		margin-left: 20rpx;
	}
	.box-r {

		.box-l{
			position: absolute;
			left: 0;
			}
		input {
			width: 100%;
			text-align: right;
			height: 100%;
			overflow: hidden;
			padding-left: 100rpx;
			box-sizing: border-box;
		}
		.bx {
			position: absolute;
			right: 100rpx;
		}
		font-size: 32rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: rgba(102, 102, 102, 1);
	}
}
.btn{
	width: 100%;
	height: 100rpx;
	line-height: 100rpx;
	font-size: 32rpx;
	color: #FFFFFF;
	position: absolute;
	bottom: 600rpx;
	background-color: #249af6;
	border-radius: 20rpx;
	text-align: center;
	
}
</style>
